package com.chenfan.process.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chenfan.process.entity.po.ProcessRelatedAttribute;
import com.chenfan.process.repository.ProcessRelatedAttributeRepository;
import com.chenfan.process.service.ProcessRelatedAttributeService;

/**
 * @author liuming
 * @date 2021/11/24
 */
@Service
public class ProcessRelatedAttributeServiceImpl extends
    ServiceImpl<ProcessRelatedAttributeRepository, ProcessRelatedAttribute> implements ProcessRelatedAttributeService {

    @Override
    public List<ProcessRelatedAttribute> listByRelatedId(List<Long> relatedList) {
        // QueryWrapper<Object> queryWrapper = QueryWrapperUtils.newQueryWrapper();
        QueryWrapper<ProcessRelatedAttribute> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(ProcessRelatedAttribute.Constants.RELATED_ID, relatedList);
        return this.list(queryWrapper);
    }

    @Override
    public List<ProcessRelatedAttribute> listWithTemplateId(List<Long> templateIdList) {
        QueryWrapper<ProcessRelatedAttribute> queryWrapper = new QueryWrapper<>();
        queryWrapper.in(ProcessRelatedAttribute.Constants.APPROVAL_TEMPLATE_ID, templateIdList);
        return this.list(queryWrapper);

    }
}
